package com.itheima.health.dao;

import com.itheima.health.pojo.Permission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.Set;

public interface PermissionMapper extends Mapper<Permission> {
    @Select("select t1.* from t_permission t1 JOIN t_role_permission t2 on t1.id = " +
            "t2.permission_id join t_role t3 on t2.role_id = t3.id where t3.id = #{id}")
    Set<Permission> findByRoleId(@Param("id") Integer id);
}
